package org.putrpctorest.resource.impl;

import org.putrpctorest.resource.CollectionType;
import org.putrpctorest.resource.Parameter;
import org.putrpctorest.resource.ParameterType;

public class ParameterImpl implements Parameter {
	private String name;
	private ParameterType type;
	private boolean encoded;
	private String defaultValue;
	private Class<?> javaType;
	private CollectionType collectionType;
	
	public void setName(String name) {
		this.name = name;
	}
	
	@Override
	public String getName() {
		return name;
	}
	
	public void setType(ParameterType type) {
		this.type = type;
	}
	
	public void setType(String type) {
		this.type = ParameterType.valueOf(type);
	}
	
	
	@Override
	public ParameterType getType() {
		return type;
	}
	
	public void setEncoded(boolean encoded) {
		this.encoded = encoded;
	}
	
	@Override
	public boolean isEncoded() {
		return encoded;
	}
	
	public void setDefaultValue(String defaultValue) {
		this.defaultValue =  defaultValue;
	}
	
	@Override
	public String getDefaultValue() {
		return defaultValue;
	}
	
	public void setJavaType(Class<?> javaType) {
		this.javaType = javaType;
	}
	
	@Override
	public Class<?> getJavaType() {
		return javaType;
	}
	
	public void setCollectionType(CollectionType collectionType) {
		this.collectionType = collectionType;
	}
	
	public void setCollectionType(String collectionType) {
		this.collectionType = CollectionType.valueOf(collectionType);
	}
	
	@Override
	public CollectionType getCollectionType() {
		return collectionType;
	}
	
}
